package com.project.baowei.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;



import com.bumptech.glide.Glide;
import com.project.baowei.bean.respoes.VerifyBean;
import com.project.baowei.contract.VerifyContract;
import com.project.baowei.prsenter.VerifyPresenter;
import com.wangshen.base.app.AppActivityKey;
import com.wangshen.base.config.BaseUrl;
import com.wangshen.base.ui.mvp.base.ui.BaseMvpActivity;
import com.wangshen.projectbase.R;


//@Route(path = AppActivityKey.VERIFYACTIVITY)
public class VerifyActivity extends BaseMvpActivity<VerifyPresenter> implements VerifyContract.View {
    VerifyBean verifyBean;

    ImageView ivBack;

    ImageView ivUser;

    TextView tvName;

    TextView tvVisitPlace;

    FrameLayout loginBt;

    TextView tvSex;

    TextView tvIdCard;

    TextView tvOrgName;

    TextView tvStartTime;

    TextView tvEndTime;

    TextView tvUserName;

    TextView tvUserOrgName;

    TextView tvUserJobName;

    @Override
    public VerifyPresenter getPresenter() {
        return new VerifyPresenter();
    }

    @Override
    public int getView() {
        return R.layout.activity_verify;
    }

    @Override
    public void initView() {
        ivBack=findViewById(R.id.iv_back);
        ivUser=findViewById(R.id.iv_user);
        tvVisitPlace=findViewById(R.id.tv_visitPlace);
        tvSex=findViewById(R.id.tv_sex);
        tvIdCard=findViewById(R.id.tv_idCard);
        tvOrgName=findViewById(R.id.tv_orgName);
        tvName=findViewById(R.id.tv_name);
        tvStartTime=findViewById(R.id.tv_startTime);
        tvEndTime=findViewById(R.id.tv_endTime);
        tvUserName=findViewById(R.id.tv_userName);
        tvUserOrgName=findViewById(R.id.tv_userOrgName);
        tvUserJobName=findViewById(R.id.tv_userJobName);
        verifyBean= (VerifyBean) getIntent().getExtras().getSerializable("Bean");
        if (verifyBean != null){
            tvName.setText(verifyBean.getName());
            Glide.with(mContext).load(BaseUrl.BASEPICURL+verifyBean.getPersonnelFile()).into(ivUser);
            tvEndTime.setText(verifyBean.getEndTime());
            tvIdCard.setText(verifyBean.getIdCard());
            tvUserName.setText(verifyBean.getUserName());
            tvOrgName.setText(verifyBean.getOrgName());
            tvUserOrgName.setText(verifyBean.getUserOrgName());
            tvStartTime.setText(verifyBean.getStartTime());
            tvVisitPlace.setText(verifyBean.getVisitPlace());
            tvUserJobName.setText(verifyBean.getUserJobName());
            if (verifyBean.getSex() == 0){
                tvSex.setText(verifyBean.getSex() == 1?"男":"女");
            }else {
                tvSex.setText(verifyBean.getSex() == 1?"男":"保密");
            }

        }

    }

    @Override
    public void initLinsenterner() {
        ivBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finishActivity();
            }
        });
    }

    @Override
    public void getData() {

    }

/*    @OnClick(R.id.iv_back)
    public void onViewClicked() {
        finishActivity();
    }*/
}
